<template>
    <div>
        <br/>
        <Result></Result>
        <br/>
        <el-button :plain="true"  @click.native="more" type="info">加载更多</el-button>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'
import Result from './Result'

export default {

components: {
    Result
  },
  data () {
    return {
    }
  },
  created(){
      console.log("组件list初始化")
      //如果tab 为空 视为首次加载
      if(this.$route.query.tab != null){
          this.$store.dispatch('getNodeList', {tab:this.$route.query.tab ,page: 1})
      }else{
          this.$router.push({ path: "good", query: { tab: 'good'}})
          this.$store.dispatch('getNodeList', {tab:"good" ,page: 1})
      }
      
  },
   methods: {
     more(){
         let page = this.$store.getters.getPage + 1;
         this.$store.dispatch('getNodeList', {tab:this.$route.query.tab ,page: page})
     }
   }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >

</style>